package com.itheima.reggie.controller;

import com.itheima.reggie.common.R;
import com.itheima.reggie.pojo.Orders;
import com.itheima.reggie.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/order")
public class OrdersController {
    @Autowired
    private OrdersService ordersService;
    @PostMapping("/submit")
    public R submit(@RequestBody Orders orders){
        R r = ordersService.sumbit(orders);
        return r;
    }
    @GetMapping("/userPage")
    public R userPage(Integer page,Integer pageSize){
        R r = ordersService.userPage(page,pageSize);
        return r;
    }
}
